package com.mathew.spring.appsp.controller;

import com.mathew.spring.appsp.conf.MQSend;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import reactor.core.publisher.Mono;

@RestController
public class FirstController {

    @Autowired
    private MQSend mq;

    @RequestMapping("/hello")
    public String handleOne() {
        String a = "abc";
        return a;
    }

    @GetMapping("/flux")
    public Mono<String> flux() {
        String div = "<div><h4>this page is first</h4></div>";
        return Mono.just(div);
    }

    @GetMapping("/send")
    public String mqSend() {
        return mq.send();
    }
}
